<?php

class MVC_View {
    var $lang_dir;
    var $data = array();

    function MVC_View() {
        $this->lang_dir = LANG_DIR;
    }

    function assign($name, $data) {
        $this->data[$name] = $data;
    }

    function display($template = "") {
        $this->assign('smarty_tela', $template);
        $this->fetch('base');
    }

    function fetch($template = "") {
        if (empty($template)) {
            exit("No template assigned");
        }
        extract($this->data);
        include TEMPLATE_DIR . $template .'.tpl.php';
    }

}
?>
